#include <stdio.h>
#include <stdlib.h>

int fib(int n)
{
    if (n <= 1)
        return n;
    int f1 = 0, f2 = 1, fn;
    for (int i = 1; i < n; i++)
    {
        fn = f1 + f2;
        f1 = f2;
        f2 = fn;
    }
    return fn;
}
int fib_2(int n)
{
    if (n <= 1)
        return n;
    return fib_2(n - 1) + fib_2(n - 2);
}

int main()
{
    /*******************code*******************/
    printf("%d %d", fib(10), fib_2(10));
    /******************************************/
    fflush(stdin);

    printf("\n\n****************************\n");
    printf("Press Enter key to continue\n");
    getchar();
    return 0;
    /******************************************/
}
